Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

160
Views
How can I "fake" fullscreen mode on iOS using playsinline?

As most web developers are aware, there’s an annoying lack of support for the full screen api in Safari on iOS. However most popular video sites such as YouTube and Vimeo have a way of faking it by allowing the user to toggle between playing the video inline (with the playsinline attribute I assume) and playing the video in the native iOS player (like when videos don’t use playsinline).

I made a simple script that I thought would do this, but it doesn’t work reliably and I’m sure there’s a better way to implement it. It goes like this:

    var video = document.getElementById('video');

    function toggleFullScreen() {
    video.pause();
    video.hasAttribute('playsinline') ? video.removeAttribute('playsinline') : video.setAttribute('playsinline', '');
    video.play();
  }

My question is: does anyone know how these sites do it? And is there a better way than toggling playsinline?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!